home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_indent.idb / usr / freeware / catman / u_man / cat1 / indent.Z / indent
Encoding:
Text File  |  1998-05-21  |  34.5 KB  |  1,189 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.      Page 1                         (printed 5/18/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV            IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))
  71.  
  72.  
  73.  
  74.      NNNNAAAAMMMMEEEE
  75.       indent - changes the appearance of a C program by inserting
  76.       or deleting whitespace.
  77.  
  78.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  79.       indent [-bad]    [-bap] [-bbb] [-bc] [-bl] [-bliN] [-br]    [-cN] [-cdN] [-cdb]
  80.            [-ce] [-ciN] [-cliN] [-cpN] [-cs] [-bs] [-dN] [-diN] [-fc1] [-fca]
  81.            [-gnu] [-iN] [-ipN] [-kr] [-lN] [-lp] [-nbad] [-nbap] [-nbbb]
  82.            [-nbc] [-ncdb] [-nce] [-ncs] [-nfc1] [-nfca] [-nip] [-nlp] [-npcs]
  83.            [-npsl] [-nsc] [-nsob] [-nss] [-nv] [-orig] [-npro] [-pcs] [-psl]
  84.            [-sc] [-sob] [-ss] [-st]    [-T] [-tsN] [-v] [-version] [file]
  85.  
  86.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  87.       This man  page  is  based  on     the  Info  file  indent.info,
  88.       produced    by    Makeinfo-1.47    from   the      input      file
  89.       indent.texinfo.  This    is Edition 0.02, 5 May    1992,  of  The
  90.       `indent' Manual, for Indent Version 1.3.
  91.  
  92.       Copyright (C)    1989, 1992 Free    Software Foundation, Inc.
  93.  
  94.      CCCCOOOOPPPPYYYYIIIINNNNGGGG
  95.       Permission is    granted    to make    and distribute verbatim    copies
  96.       of  this  manual  provided  the  copyright  notice  and this
  97.       permission notice are    preserved on all copies.
  98.  
  99.      IIIINNNNTTTTRRRROOOODDDDUUUUCCCCTTTTIIIIOOOONNNN
  100.       The `indent' program can be used  to    make  code  easier  to
  101.       read.      It  can  also    convert    from one style of writing C to
  102.       another.
  103.  
  104.       `indent' understands a substantial amount about  the    syntax
  105.       of  C,  but  it  also     attempts  to cope with    incomplete and
  106.       misformed syntax.
  107.  
  108.       In version 1.2 and more recent versions, the    GNU  style  of
  109.       indenting is the default.
  110.  
  111.      IIIINNNNVVVVOOOOKKKKIIIINNNNGGGG IIIINNNNDDDDEEEENNNNTTTT
  112.       As of    version    1.3, the format    of the `indent'    command    is:
  113.  
  114.            indent [OPTIONS]    [INPUT-FILES]
  115.  
  116.            indent [OPTIONS]    [SINGLE-INPUT-FILE] [-o    OUTPUT-FILE]
  117.  
  118.       This format is different from     earlier  versions  and     other
  119.       versions of `indent'.
  120.  
  121.       In the first form, one or more input    files  are  specified.
  122.       `indent'  makes a backup copy    of each    file, and the original
  123.       file is replaced with    its indented  version.     *Note    Backup
  124.       files::, for an explanation of how backups are made.
  125.  
  126.  
  127.  
  128.  
  129.      Page 1                         (printed 5/18/98)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV            IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))
  137.  
  138.  
  139.  
  140.       In the second    form, only one input file  is  specified.   In
  141.       this    case,  or  when     the  standard    input is used, you may
  142.       specify an output file after the `-o'    option.
  143.  
  144.       To cause `indent' to write to    standard output, use the `-st'
  145.       option.   This  is only allowed when there is    only one input
  146.       file,    or when    the standard input is used.
  147.  
  148.       If no    input files are    named, the standard input is read  for
  149.       input.  Also,    if a filename named `-'    is specified, then the
  150.       standard input is read.
  151.  
  152.       As an    example, each of the following commands    will input the
  153.       program  `slithy_toves.c'  and  write     its  indented text to
  154.       `slithy_toves.out':
  155.  
  156.            indent slithy_toves.c -o    slithy_toves.out
  157.  
  158.            indent -st slithy_toves.c > slithy_toves.out
  159.  
  160.            cat slithy_toves.c | indent -o slithy_toves.out
  161.  
  162.       Most other options to     `indent'  control  how     programs  are
  163.       formatted.   As  of  version 1.2, `indent' also recognizes a
  164.       long name for    each option name.  Long    options     are  prefixed
  165.       by  either  `--' or `+'.  `+'    is being superseded by `--' to
  166.       maintain consistency with the    POSIX standard.      In  most  of
  167.       this document, the traditional, short    names are used for the
  168.       sake of brevity.
  169.  
  170.       Here is another example:
  171.  
  172.            indent -br test/metabolism.c -l85
  173.  
  174.       This will indent the program `test/metabolism.c'  using  the
  175.       `-br'      and    `-l85'    options,  write     the  output  back  to
  176.       `test/metabolism.c', and  write  the    original  contents  of
  177.       `test/metabolism.c'  to  a  backup  file  in    the  directory
  178.       `test'.
  179.  
  180.       Equivalent invocations using    long  option  names  for  this
  181.       example would    be:
  182.  
  183.            indent        --braces-on-if-line          --line-length185
  184.            test/metabolism.c
  185.  
  186.            indent         +braces-on-if-line           +line-length185
  187.            test/metabolism.c
  188.  
  189.       If you find that  you     often    use  `indent'  with  the  same
  190.       options,  you     may  put  those  options  into     a file    called
  191.       `.indent.pro'. `indent' will first look for `.indent.pro' in
  192.  
  193.  
  194.  
  195.      Page 2                         (printed 5/18/98)
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.      IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV            IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))
  203.  
  204.  
  205.  
  206.       the  current    directory  and    use that if found.  Otherwise,
  207.       `indent' will    search your home directory  for     `.indent.pro'
  208.       and  use  that  file    if  it    is  found.   This behaviour is
  209.       different from that of other    versions  of  `indent',     which
  210.       load both files if they both exist.
  211.  
  212.       Command  line     switches  are    handled      *after*   processing
  213.       `.indent.pro'.  Options  specified  later override arguments
  214.       specified earlier, with one exception: Explicitly  specified
  215.       options  always  override  background     options (*note    Common
  216.       styles::.).    You  can  prevent  `indent'  from  reading  an
  217.       `.indent.pro'    file by    specifying the `-npro' option.
  218.  
  219.      BBBBAAAACCCCKKKKUUUUPPPP FFFFIIIILLLLEEEESSSS
  220.       As of    version    1.3,  GNU  `indent'  makes  GNU--style    backup
  221.       files,  the same way GNU Emacs does.    This means that    either
  222.       "simple" or "numbered" backup    filenames may be made.
  223.  
  224.       Simple backup    file names are generated by appending a    suffix
  225.       to  the original file    name.  The default for the this    suffix
  226.       is the one-character string `~' (tilde).  Thus,  the    backup
  227.       file for `python.c' would be `python.c~'.
  228.  
  229.       Instead of the default, you may  specify  any     string     as  a
  230.       suffix     by        setting    the    environment    variable
  231.       `SIMPLE_BACKUP_SUFFIX' to your preferred suffix.
  232.  
  233.       Numbered backup versions of a    file  `momewraths'  look  like
  234.       `momewraths.c.~23~',     where    23  is    the  version  of  this
  235.       particular backup.  When making a  numbered  backup  of  the
  236.       file    `src/momewrath.c',  the     backup     file  will  be     named
  237.       `src/momewrath.c.~V~', where    V  is  one  greater  than  the
  238.       highest version currently existing in    the directory `src'.
  239.  
  240.       The type of backup file made is controlled by    the  value  of
  241.       the  environment  variable  `VERSION_CONTROL'.  If it    is the
  242.       string `simple', then    only simple backups will be made.   If
  243.       its  value  is  the string `numbered', then numbered backups
  244.       will be made.     If its     value    is  `numbered-existing',  then
  245.       numbered  backups  will  be  made  if     there *already    exist*
  246.       numbered backups for the file    being indented;     otherwise,  a
  247.       simple  backup  is  made.   If `VERSION_CONTROL' is not set,
  248.       then `indent'    assumes    the behaviour of `numbered-existing'.
  249.  
  250.       Other    versions of `indent' use the suffix `.BAK'  in    naming
  251.       backup  files.   This     behaviour  can    be emulated by setting
  252.       `SIMPLE_BACKUP_SUFFIX' to `.BAK'.
  253.  
  254.       Note also that other versions    of `indent'  make  backups  in
  255.       the  current    directory, rather than in the directory    of the
  256.       source file as GNU `indent' now does.
  257.  
  258.  
  259.  
  260.  
  261.      Page 3                         (printed 5/18/98)
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.      IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV            IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))
  269.  
  270.  
  271.  
  272.      CCCCOOOOMMMMMMMMOOOONNNN SSSSTTTTYYYYLLLLEEEESSSS
  273.       There    are several common styles of C code, including the GNU
  274.       style,  the  Kernighan  &  Ritchie  style,  and the original
  275.       Berkeley style.  A style  may     be  selected  with  a    single
  276.       "background" option, which specifies a set of    values for all
  277.       other    options.  However, explicitly specified    options    always
  278.       override options implied by a    background option.
  279.  
  280.       As of    version    1.2, the default style of GNU `indent' is  the
  281.       GNU  style.  Thus, it    is no longer neccessary    to specify the
  282.       option `-gnu'    to obtain this format, although    doing so  will
  283.       not  cause an    error. Option settings which correspond    to the
  284.       GNU style are:
  285.  
  286.            -nbad -bap -nbbb    -nbc -bl -bli2 -c33 -cd33  -ncdb  -nce
  287.            -cli0 -cp1 -di0 -nfc1 -nfca -i2 -ip5 -lp    -pcs -psl -nsc
  288.            -nsob -nss -ts8
  289.  
  290.       The GNU coding style is that preferred by the     GNU  project.
  291.       It  is  the  style  that the GNU Emacs C mode    encourages and
  292.       which    is used    in the    C  portions  of     GNU  Emacs.   (People
  293.       interested  in writing programs for Project GNU should get a
  294.       copy of  `The     GNU  Coding  Standards',  which  also    covers
  295.       semantic  and     portability  issues such as memory usage, the
  296.       size of integers, etc.)
  297.  
  298.       The Kernighan    &  Ritchie  style  is  used  throughout     their
  299.       well-known book `The C Programming Language'.     It is enabled
  300.       with the  `-kr'  option.   The  Kernighan  &    Ritchie     style
  301.       corresponds to the following set of options:
  302.  
  303.            -nbad -bap -nbbb    -nbc -br -c33  -cd33  -ncdb  -ce  -ci4
  304.            -cli0  -cp33  -d0  -di1    -nfc1  -nfca -i4 -ip0 -l75 -lp
  305.            -npcs -npsl -nsc    -nsob -nss -ts8
  306.  
  307.       Kernighan & Ritchie style does not put comments to the right
  308.       of  code  in    the  same column at all    times (nor does    it use
  309.       only one space to the    right of the code), so for this     style
  310.       `indent' has arbitrarily chosen column 33.
  311.  
  312.       The style of the original Berkeley `indent' may be  obtained
  313.       by  specifying  `-orig'  (or    by  specifyfying `--original',
  314.       using    the long option    name).    This style  is    equivalent  to
  315.       the following    settings:
  316.  
  317.            -nbap -nbad -nbbb -bc -br  -c33    -cd33  -cdb  -ce  -ci4
  318.            -cli0 -cp33 -d4 -di16 -fc1 -fca -i4 -ip4    -l75 -lp -npcs
  319.            -psl -sc    -nsob -nss -ts8
  320.  
  321.  
  322.      BBBBLLLLAAAANNNNKKKK LLLLIIIINNNNEEEESSSS
  323.       Various programming styles  use  blank  lines     in  different
  324.  
  325.  
  326.  
  327.      Page 4                         (printed 5/18/98)
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.      IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV            IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))
  335.  
  336.  
  337.  
  338.       places.   `indent'  has  a  number  of  options to insert or
  339.       delete blank lines in    specific places.
  340.  
  341.       The `-bad' option causes `indent'  to     force    a  blank  line
  342.       after     every    block  of  declarations.   The    `-nbad'    option
  343.       causes `indent' not to force such blank lines.
  344.  
  345.       The `-bap' option forces a blank line    after every  procedure
  346.       body.     The `-nbap' option forces no such blank line.
  347.  
  348.       The `-bbb' option forces a blank  line  before  every     block
  349.       comment.  A  block comment is    one which starts in column one
  350.       when formatting of such comments is disabled,     or  one  with
  351.       `-'  or  `*'    immediately  following    the `/*'.  The `-nbbb'
  352.       option does not force    such blank lines.
  353.  
  354.       The `-sob' option causes `indent' to swallow optional     blank
  355.       lines     (that    is,  any  optional  blank lines    present    in the
  356.       input    will be    removed    from the output).  If the  `-nsob'  is
  357.       specified, any blank lines present in    the input file will be
  358.       copied to the    output file.
  359.  
  360.       The `-bad' option forces a blank line    after every  block  of
  361.       declarations.      The  `-nbad'    option    does  not add any such
  362.       blank    lines.
  363.  
  364.       For example, given the input
  365.  
  366.             char *foo;
  367.             char *bar;
  368.             /* This separates blocks of    declarations.  */
  369.             int    baz;
  370.  
  371.       `indent -bad'    produces
  372.  
  373.  
  374.             char *foo;
  375.             char *bar;
  376.  
  377.             /* This separates blocks of    declarations.  */
  378.             int    baz;
  379.  
  380.       and `indent -nbad' produces
  381.  
  382.             char *foo;
  383.             char *bar;
  384.             /* This separates blocks of    declarations.  */
  385.             int    baz;
  386.  
  387.       The `-bap' option forces a blank line    after every  procedure
  388.       body.     For example, given the    input
  389.  
  390.  
  391.  
  392.  
  393.      Page 5                         (printed 5/18/98)
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.      IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV            IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))
  401.  
  402.  
  403.  
  404.             int
  405.             foo    ()
  406.             {
  407.               puts("Hi");
  408.             }
  409.             /* The procedure bar is even less interesting.  */
  410.             char *
  411.             bar    ()
  412.             {
  413.               puts("Hello");
  414.             }
  415.  
  416.       `indent -bap'    produces
  417.  
  418.             int
  419.             foo    ()
  420.             {
  421.               puts ("Hi");
  422.             }
  423.  
  424.             /* The procedure bar is even less interesting.  */
  425.             char *
  426.             bar    ()
  427.             {
  428.               puts ("Hello");
  429.             }
  430.  
  431.       and `indent -nbap' produces
  432.  
  433.             int
  434.             foo    ()
  435.             {
  436.               puts ("Hi");
  437.             }
  438.             /* The procedure bar is even less interesting.  */
  439.             char *
  440.             bar    ()
  441.             {
  442.               puts ("Hello");
  443.             }
  444.  
  445.       No blank line    will be    added after the    procedure `foo'.
  446.  
  447.      CCCCOOOOMMMMMMMMEEEENNNNTTTTSSSS
  448.       Comments are no longer formatted by default  as  of  version
  449.       1.2.     This can be enabled with the `-fca' option.  Doing so
  450.       will cause newlines in the comment text to  be  ignored  and
  451.       the  line  will  be filled up    to the length of a line    (which
  452.       can be modified with `-l').    When  formatting  is  enabled,
  453.       blank    lines indicate paragraph breaks.
  454.  
  455.       The `-fc1' option enables the    formatting of  comments     which
  456.  
  457.  
  458.  
  459.      Page 6                         (printed 5/18/98)
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.      IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV            IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))
  467.  
  468.  
  469.  
  470.       begin     in the    first column.  The `-nfc1' option disables the
  471.       formatting  of  first      column   comments.    When   comment
  472.       formatting  is  disabled,  overall  comment  indentation may
  473.       still    be adjusted.
  474.  
  475.       The indentation of comments which do not appear to the right
  476.       of  code  is    set  by     the  `-d' option, which specifies the
  477.       number of spaces to the left of the  surrounding  code  that
  478.       the comment appears.    For example, `-d2' places comments two
  479.       spaces to the    left of    code; `-d0' lines up comments with the
  480.       code.      The `-cdb' option controls whether the `/*' and `*/'
  481.       are placed on    blank lines.  With `-cdb', comments look  like
  482.       this:
  483.  
  484.             /*
  485.              * this is a comment
  486.              */
  487.  
  488.       With `-ncdb',    comments look like this:
  489.  
  490.             /* this is a comment */
  491.  
  492.       `-cdb' only affects block  comments,    not  comments  to  the
  493.       right    of code. The default is    `-ncdb'.
  494.  
  495.       Comments which appear    on the same line as code are placed to
  496.       the  right.  The  column  in which comments on code start is
  497.       controlled by    the `-c' option.  The column in    which comments
  498.       to  the  right of declarations start is controlled by    the `-
  499.       cd' option.  By default, they    start in the  same  column  as
  500.       comments  to    the  right  of    code, which is column 33.  The
  501.       column number    for comments  to  the  right  of  `#else'  and
  502.       `#endif'  statements    is controlled by the `-cp' option.  If
  503.       the code on a    line extends  past  the     comment  column,  the
  504.       comment  starts  further  to the right, and the right    margin
  505.       may be automatically extended    in extreme cases.
  506.  
  507.       If the `-sc' option is specified, `*'    is placed at the  left
  508.       edge of all comments.     For example:
  509.  
  510.             /* This is a comment which extends from one    line
  511.              * onto the    next line, thus    causing    us to consider
  512.              * how it should continue.    */
  513.  
  514.       instead of
  515.  
  516.             /* This is a comment which extends from one    line
  517.                onto the    next line, thus    causing    us to consider
  518.                how it should continue.    */
  519.  
  520.  
  521.      SSSSTTTTAAAATTTTEEEEMMMMEEEENNNNTTTTSSSS
  522.  
  523.  
  524.  
  525.      PPPPaaaaggggeeee 7777                         ((((pppprrrriiiinnnntttteeeedddd 5555////11118888////99998888))))
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.      IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV            IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))
  533.  
  534.  
  535.  
  536.       The `-br' or `-bl' option specifies how  to  format  braces.
  537.       The `-br' option formats braces like this:
  538.  
  539.             if (x > 0) {
  540.               x--;
  541.             }
  542.  
  543.       The `-bl' option formats them    like this:
  544.  
  545.             if (x > 0)
  546.               {
  547.             x--;
  548.               }
  549.  
  550.       If you use the `-bl' option, you may also  want  to  specify
  551.       the  `-bli'  option.     This  option  specifies the number of
  552.       spaces by which braces are indented.    `-bli2', the  default,
  553.       gives     the  result  shown  above.   `-bli0'  results    in the
  554.       following:
  555.  
  556.             if (x > 0)
  557.             {
  558.               x--;
  559.             }
  560.  
  561.       If you are using the `-br' option, you probably want to also
  562.       use  the  `-ce'  option.   This  causes the `else' in    an if-
  563.       then-else  construct    to  cuddle  up    to   the   immediately
  564.       preceding  `}'.   For     example,  with     `-br -ce' you get the
  565.       following:
  566.  
  567.             if (x > 0) {
  568.               x--;
  569.             } else {
  570.               fprintf (stderr, "...something wrong?0);
  571.             }
  572.  
  573.       With `-br -nce' that code would appear as
  574.  
  575.             if (x > 0) {
  576.               x--;
  577.             }
  578.             else {
  579.               fprintf (stderr, "...something wrong?0);
  580.             }
  581.  
  582.       The `-cli' option specifies the number of spaces  that  case
  583.       labels  should  be  indented    to the right of    the containing
  584.       `switch' statement.
  585.  
  586.       If a semicolon is on the same    line as     a  `for'  or  `while'
  587.       statement,  the `-ss'    option will cause a space to be    placed
  588.  
  589.  
  590.  
  591.      Page 8                         (printed 5/18/98)
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.      IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV            IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))
  599.  
  600.  
  601.  
  602.       before the semicolon.    This emphasizes    the semicolon,    making
  603.       it  clear that the body of the `for' or `while' statement is
  604.       an empty statement. `-nss' disables this feature.
  605.  
  606.       The `-pcs' option causes a space to be  placed  between  the
  607.       name of the procedure    being called and the `(' (for example,
  608.       `puts      ("Hi");'.   The   `-npcs'    option     would      give
  609.       `puts("Hi");').
  610.  
  611.       If the `-cs' option is  specified,  `indent'    puts  a     space
  612.       after    a cast operator.
  613.  
  614.       The `-bs' option ensures that    there is a space  between  the
  615.       keyword  `sizeof'  and its argument.    In some    versions, this
  616.       is known as the `Bill_Shannon' option.
  617.  
  618.      DDDDEEEECCCCLLLLAAAARRRRAAAATTTTIIIIOOOONNNNSSSS
  619.       By default `indent' will line    up identifiers,    in the    column
  620.       specified  by     the `-di' option.  For    example, `-di16' makes
  621.       things look like:
  622.  
  623.             int            foo;
  624.             char       *bar;
  625.  
  626.       Using    a small    value (such as    one  or     two)  for  the     `-di'
  627.       option can be    used to    cause the indentifiers to be placed in
  628.       the first available position,    for example
  629.  
  630.             int    foo;
  631.             char *bar;
  632.  
  633.       The value given  to  the  `-di'  option  will     still    affect
  634.       variables  which are put on separate lines from their    types,
  635.       for example `-di2' will lead to
  636.  
  637.             int
  638.               foo;
  639.  
  640.       If the `-bc' option is specified, a newline is forced     after
  641.       each comma in    a declaration.    For example,
  642.  
  643.             int    a,
  644.               b,
  645.               c;
  646.  
  647.       With the `-nbc' option this would look like
  648.  
  649.             int    a, b, c;
  650.  
  651.       The `-psl' option causes  the     type  of  a  procedure     being
  652.       defined  to  be  placed  on  the line    before the name    of the
  653.       procedure.  This style is required for the  `etags'  program
  654.  
  655.  
  656.  
  657.      Page 9                         (printed 5/18/98)
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.      IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV            IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))
  665.  
  666.  
  667.  
  668.       to work correctly, as    well as    some of    the `c-mode' functions
  669.       of Emacs.
  670.  
  671.       If you are not using the `-di1' option  to  place  variables
  672.       being    declared immediately after their type, you need    to use
  673.       the `-T' option  to  tell  `indent'  the  name  of  all  the
  674.       typenames  in     your  program    that are defined by `typedef'.
  675.       `-T'    can  be     specified  more  than    once,  and  all     names
  676.       specified are    used.  For example, if your program contains
  677.  
  678.             typedef unsigned long CODE_ADDR;
  679.             typedef enum {red, blue, green} COLOR;
  680.  
  681.       you would use    the options `-T    CODE_ADDR -T COLOR'.
  682.  
  683.      IIIINNNNDDDDEEEENNNNTTTTAAAATTTTIIIIOOOONNNN
  684.       One issue in the formatting of code is  how  far  each  line
  685.       should be indented from the left margin.  When the beginning
  686.       of a statement such as `if' or  `for'     is  encountered,  the
  687.       indentation level is increased by the    value specified    by the
  688.       `-i' option.    For example, use `-i8'    to  specify  an     eight
  689.       character  indentation  for  each level. When    a statement is
  690.       continued from a previous line, it is    indented by  a    number
  691.       of  additional  spaces  specified by the `-ci' option. `-ci'
  692.       defaults to 0. However, if the `-lp'    option    is  specified,
  693.       and  a  line    has  a left parenthesis    which is not closed on
  694.       that line, then continuation lines will be lined up to start
  695.       at  the  character position just after the left parenthesis.
  696.       This processing also applies to `[' and applies to `{'  when
  697.       it  occurs in    initialization lists.  For example, a piece of
  698.       continued code might look like  this    with  `-nlp  -ci3'  in
  699.       effect:
  700.  
  701.               p1 = first_procedure (second_procedure (p2, p3),
  702.              third_procedure (p4, p5));
  703.  
  704.       With `-lp' in    effect the code    looks somewhat clearer:
  705.  
  706.               p1 = first_procedure (second_procedure (p2, p3),
  707.                         third_procedure (p4, p5));
  708.  
  709.       `indent' assumes that    tabs are placed    at  regular  intervals
  710.       of both input    and output character streams.  These intervals
  711.       are by default 8 columns wide, but (as of version  1.2)  may
  712.       be  changed  by  the    `-ts' option.  Tabs are    treated    as the
  713.       equivalent number of spaces.
  714.  
  715.       The indentation of type declarations in  old-style  function
  716.       definitions is controlled by the `-ip' parameter.  This is a
  717.       numeric parameter specifying how many    spaces to indent  type
  718.       declarations.       For     example,  the    default     `-ip5'     makes
  719.       definitions look like    this:
  720.  
  721.  
  722.  
  723.      Page 10                         (printed 5/18/98)
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.      IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV            IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))
  731.  
  732.  
  733.  
  734.             char *
  735.             create_world (x, y,    scale)
  736.              int x;
  737.              int y;
  738.              float scale;
  739.             {
  740.               .    . .
  741.             }
  742.  
  743.       For compatibility with other versions    of indent, the    option
  744.       `-nip' is provided, which is equivalent to `-ip0'.
  745.  
  746.  
  747.      MMMMIIIISSSSCCCCEEEELLLLLLLLAAAANNNNEEEEOOOOUUUUSSSS OOOOPPPPTTTTIIIIOOOONNNNSSSS
  748.       To find out what version  of    `indent'  you  have,  use  the
  749.       command  `indent  -version'.     This  will report the version
  750.       number  of  `indent',     without  doing     any  of  the    normal
  751.       processing.
  752.  
  753.       The `-v' option can be used to turn on verbose  mode.      When
  754.       in verbose mode, `indent' reports when it splits one line of
  755.       input    into two more more lines of  output,  and  gives  some
  756.       size statistics at completion.
  757.  
  758.      CCCCOOOOPPPPYYYYRRRRIIIIGGGGHHHHTTTT
  759.       The following     copyright  notice  applies  to     the  `indent'
  760.       program.  The     copyright  and     copying  permissions for this
  761.       manual appear    near the beginning of this document.
  762.            Copyright (c) 1989, 1992    Free Software Foundation
  763.            Copyright (c) 1985 Sun Microsystems, Inc.
  764.            Copyright (c) 1980 The Regents of the University    of California.
  765.            Copyright (c) 1976 Board    of Trustees of the University of Illinois.
  766.            All rights reserved.
  767.  
  768.            Redistribution and use in source    and binary forms are permitted
  769.            provided    that the above copyright notice    and this paragraph are
  770.            duplicated in all such forms and    that any documentation,
  771.            advertising materials, and other    materials related to such
  772.            distribution and    use acknowledge    that the software was developed
  773.            by the University of California,    Berkeley, the University of Illinois,
  774.            Urbana, and Sun Microsystems, Inc.  The name of either University
  775.            or Sun Microsystems may not be used to endorse or promote products
  776.            derived from this software without specific prior written permission.
  777.            THIS SOFTWARE IS    PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  778.            IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  779.            WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  780.            PURPOSE.
  781.  
  782.      OOOOPPPPTTTTIIIIOOOONNNNSSSS
  783.       Here is a list of all    the options for    `indent', alphabetized
  784.       by short option.  It is followed by a    cross key alphabetized
  785.       by long option.
  786.  
  787.  
  788.  
  789.      Page 11                         (printed 5/18/98)
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.      IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV            IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))
  797.  
  798.  
  799.  
  800.       `-bad'
  801.       `--blank-lines-after-declarations'
  802.            Force blank lines after the declarations.
  803.  
  804.       `-bap'
  805.       `--blank-lines-after-procedures'
  806.            Force blank lines after procedure bodies.
  807.  
  808.       `-bbb'
  809.       `--blank-lines-after-block-comments'
  810.            Force blank lines after block comments.
  811.  
  812.       `-bc'
  813.       `--blank-lines-after-commas'
  814.            Force newline after comma in declaration.
  815.  
  816.       `-bl'
  817.       `--braces-after-if-line'
  818.            Put braces on line after    `if', etc.
  819.  
  820.       `-bliN'
  821.       `--brace-indentN'
  822.            Indent braces N spaces.
  823.  
  824.       `-br'
  825.       `--braces-on-if-line'
  826.            Put braces on line with `if', etc.
  827.  
  828.       `-cN'
  829.       `--comment-indentationN'
  830.            Put comments to the right of code in column N.
  831.  
  832.       `-cdN'
  833.       `--declaration-comment-columnN'
  834.            Put comments to the right of the    declarations in    column N.
  835.  
  836.       `-cdb'
  837.       `--comment-delimiters-on-blank-lines'
  838.            Put comment delimiters on blank lines.
  839.  
  840.       `-ce'
  841.       `--cuddle-else'
  842.            Cuddle else and preceeding `}'.
  843.  
  844.       `-ciN'
  845.       `--continuation-indentationN'
  846.            Continuation indent of N    spaces.
  847.  
  848.       `-cliN'
  849.       `--case-indentationN'
  850.            Case label indent of N spaces.
  851.  
  852.  
  853.  
  854.  
  855.      Page 12                         (printed 5/18/98)
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.      IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV            IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))
  863.  
  864.  
  865.  
  866.       `-cpN'
  867.       `--else-endif-columnN'
  868.            Put comments to the right of `#else' and    `#endif' statements in
  869.            column N.
  870.  
  871.       `-cs'
  872.       `--space-after-cast'
  873.            Put a space after a cast    operator.
  874.  
  875.       `-bs'
  876.       `--blank-before-sizeof'
  877.            Put a space between `sizeof' and    its argument.
  878.  
  879.       `-dN'
  880.       `--line-comments-indentationN'
  881.            Set indentation of comments not to the right of code to N spaces.
  882.  
  883.       `-diN'
  884.       `--declaration-indentationN'
  885.            Put variables in    column N.
  886.  
  887.       `-fc1'
  888.       `--format-first-column-comments'
  889.            Format comments in the first column.
  890.  
  891.       `-fca'
  892.       `--format-all-comments'
  893.            Do not disable all formatting of    comments.
  894.  
  895.       `-gnu'
  896.       `--gnu-style'
  897.            Use GNU coding style.  This is the default.
  898.  
  899.       `-iN'
  900.       `--indent-levelN'
  901.            Set indentation level to    N spaces.
  902.  
  903.       `-ipN'
  904.       `--parameter-indentationN'
  905.            Indent parameter    types in old-style function definitions    by N
  906.            spaces.
  907.  
  908.       `-kr'
  909.       `--k-and-r-style'
  910.            Use Kernighan & Ritchie coding style.
  911.  
  912.       `-lN'
  913.       `--line-lengthN'
  914.            Set maximum line    length to N.
  915.  
  916.       `-lp'
  917.       `--continue-at-parentheses'
  918.  
  919.  
  920.  
  921.      Page 13                         (printed 5/18/98)
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.      IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV            IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))
  929.  
  930.  
  931.  
  932.            Line up continued lines at parentheses.
  933.  
  934.       `-nbad'
  935.       `--no-blank-lines-after-declarations'
  936.            Do not force blank lines    after declarations.
  937.  
  938.       `-nbap'
  939.       `--no-blank-lines-after-procedures'
  940.            Do not force blank lines    after procedure    bodies.
  941.  
  942.       `-nbbb'
  943.       `--no-blank-lines-after-block-comments'
  944.            Do not force blank-lines    after block comments.
  945.  
  946.       `-nbc'
  947.       `--no-blank-lines-after-commas'
  948.            Do not force newlines after commas in declarations.
  949.  
  950.       `-ncdb'
  951.       `--no-comment-delimiters-on-blank-lines'
  952.            Do not put comment delimiters on    blank lines.
  953.  
  954.       `-nce'
  955.       `--dont-cuddle-else'
  956.            Do not cuddle `}' and `else'.
  957.  
  958.       `-ncs'
  959.       `--no-space-after-casts'
  960.            Do not put a space after    cast operators.
  961.  
  962.       `-nfc1'
  963.       `--dont-format-first-column-comments'
  964.            Do not format comments in the first column as normal.
  965.  
  966.       `-nfca'
  967.       `--dont-format-comments'
  968.            Do not format any comments.
  969.  
  970.       `-nip'
  971.       `--no-parameter-indentation'
  972.            Zero width indentation for parameters.
  973.  
  974.       `-nlp'
  975.       `--dont-line-up-parentheses'
  976.            Do not line up parentheses.
  977.  
  978.       `-npcs'
  979.       `--no-space-after-function-call-names'
  980.            Do not put space    after the function in function calls.
  981.  
  982.       `-npsl'
  983.       `--dont-break-procedure-type'
  984.  
  985.  
  986.  
  987.      Page 14                         (printed 5/18/98)
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.      IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV            IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))
  995.  
  996.  
  997.  
  998.            Put the type of a procedure on the same line as its name.
  999.  
  1000.       `-nsc'
  1001.       `--dont-star-comments'
  1002.            Do not put the `*' character at the left    of comments.
  1003.  
  1004.       `-nsob'
  1005.       `--leave-optional-blank-lines'
  1006.            Do not swallow optional blank lines.
  1007.  
  1008.       `-nss'
  1009.       `--dont-space-special-semicolon'
  1010.            Do not force a space before the semicolon after certain statements.
  1011.            Disables    `-ss'.
  1012.  
  1013.       `-nv'
  1014.       `--no-verbosity'
  1015.  
  1016.       `-orig'
  1017.       `--original'
  1018.            Use the original    Berkeley coding    style.
  1019.  
  1020.       `-npro'
  1021.       `--ignore-profile'
  1022.            Do not read `.indent.pro' files.
  1023.  
  1024.       `-pcs'
  1025.       `--space-after-procedure-calls'
  1026.            Insert a    space between the name of the procedure    being called and
  1027.            the `('.
  1028.  
  1029.       `-psl'
  1030.       `--procnames-start-lines'
  1031.            Put the type of a procedure on the line before its name.
  1032.  
  1033.       `-sc'
  1034.       `--start-left-side-of-comments'
  1035.            Put the `*' character at    the left of comments.
  1036.  
  1037.       `-sob'
  1038.       `--swallow-optional-blank-lines'
  1039.            Swallow optional    blank lines.
  1040.  
  1041.       `-ss'
  1042.       `--space-special-semicolon'
  1043.            On one-line `for' and `while' statments,    force a    blank before the
  1044.            semicolon.
  1045.  
  1046.       `-st'
  1047.       `--standard-output'
  1048.            Write to    standard output.
  1049.  
  1050.  
  1051.  
  1052.  
  1053.      Page 15                         (printed 5/18/98)
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.      IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV            IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))
  1061.  
  1062.  
  1063.  
  1064.       `-T'
  1065.            Tell `indent' the name of typenames.
  1066.  
  1067.       `-tsN'
  1068.       `--tab-sizeN'
  1069.            Set tab size to N spaces.
  1070.  
  1071.       `-v'
  1072.       `--verbose'
  1073.            Enable verbose mode.
  1074.  
  1075.       `-version'
  1076.            Output the version number of `indent'.
  1077.  
  1078.  
  1079.      OOOOPPPPTTTTIIIIOOOONNNNSSSS CCCCRRRROOOOSSSSSSSS----RRRREEEEFFFFEEEERRRREEEENNNNCCCCEEEE
  1080.       Here is a list of options alphabetized by  long  option,  to
  1081.       help you find    the corresponding short    option.
  1082.  
  1083.             --blank-lines-after-block-comments            -bbb
  1084.             --blank-lines-after-commas                -bc
  1085.             --blank-lines-after-declarations            -bad
  1086.             --blank-lines-after-procedures            -bap
  1087.             --braces-after-if-line                -bl
  1088.             --brace-indent                    -bli
  1089.             --braces-on-if-line                    -br
  1090.             --case-indentation                    -cliN
  1091.             --comment-delimiters-on-blank-lines            -cdb
  1092.             --comment-indentation                -cN
  1093.             --continuation-indentation                -ciN
  1094.             --continue-at-parentheses                -lp
  1095.             --cuddle-else                    -ce
  1096.             --declaration-comment-column            -cdN
  1097.             --declaration-indentation                -diN
  1098.             --dont-break-procedure-type                -npsl
  1099.             --dont-cuddle-else                    -nce
  1100.             --dont-format-comments                -nfca
  1101.             --dont-format-first-column-comments            -nfc1
  1102.             --dont-line-up-parentheses                -nlp
  1103.             --dont-space-special-semicolon            -nss
  1104.             --dont-star-comments                -nsc
  1105.             --else-endif-column                    -cpN
  1106.             --format-all-comments                -fca
  1107.             --format-first-column-comments            -fc1
  1108.             --gnu-style                        -gnu
  1109.             --ignore-profile                    -npro
  1110.             --indent-level                    -iN
  1111.             --k-and-r-style                    -kr
  1112.             --leave-optional-blank-lines            -nsob
  1113.             --line-comments-indentation                -dN
  1114.             --line-length                    -lN
  1115.             --no-blank-lines-after-block-comments        -nbbb
  1116.  
  1117.  
  1118.  
  1119.      Page 16                         (printed 5/18/98)
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.      IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))               UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV            IIIINNNNDDDDEEEENNNNTTTT((((1111LLLL))))
  1127.  
  1128.  
  1129.  
  1130.             --no-blank-lines-after-commas            -nbc
  1131.             --no-blank-lines-after-declarations            -nbad
  1132.             --no-blank-lines-after-procedures            -nbap
  1133.             --no-comment-delimiters-on-blank-lines        -ncdb
  1134.             --no-space-after-casts                -ncs
  1135.             --no-parameter-indentation                -nip
  1136.             --no-space-after-function-call-names        -npcs
  1137.             --no-verbosity                    -nv
  1138.             --original                        -orig
  1139.             --parameter-indentation                -ipN
  1140.             --procnames-start-lines                -psl
  1141.             --space-after-cast                    -cs
  1142.             --space-after-procedure-calls            -pcs
  1143.             --space-special-semicolon                -ss
  1144.             --standard-output                    -st
  1145.             --start-left-side-of-comments            -sc
  1146.             --swallow-optional-blank-lines            -sob
  1147.             --tab-size                        -tsN
  1148.             --verbose                        -v
  1149.  
  1150.  
  1151.      RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
  1152.       Unknown
  1153.  
  1154.      FFFFIIIILLLLEEEESSSS
  1155.       $_H_O_M_E/._i_n_d_e_n_t._p_r_o         holds default options for indent.
  1156.  
  1157.      AAAAUUUUTTTTHHHHOOOORRRR
  1158.       The Free Software Foundation.
  1159.  
  1160.      HHHHIIIISSSSTTTTOOOORRRRYYYY
  1161.       Derived from the UCB program "indent".
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.      Page 17                         (printed 5/18/98)
  1186.  
  1187.  
  1188.  
  1189.